#include <cstdio>
#include <cmath>
#define PI 3.14159265
//double PI = std::atan(1.00) * 4.00;
int main(){ 
	freopen("in.txt","r",stdin);freopen("out.txt","w",stdout);
	int r, x, y, t=1;

	scanf("%d", &r);
	while(r){
		printf("Test Rig %d\n", t++);
		scanf("%d%d", &x, &y);
		
		while(x&&y){
			printf("%d\n", (  (int)(x/((r<<1)*sin(y*PI/180.0)))  ));
			scanf("%d%d", &x, &y);
		}
		scanf("%d", &r);
		printf("\n");
	}
	return 0;
}
